//
//  THWindowPriority.h
//  MengLiao
//
//  Created by xiuxin on 2022/7/15.
//  Copyright © 2022 BaseBusiness. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@protocol HQWindowDismissProtocl <NSObject>

- (void)dismiss;

@end

typedef NS_ENUM(NSUInteger, HQWindowViewPriority)
{
    HQWindowViewPriorityNone = 0,
    HQWindowViewPriorityVeryLow = 100,
    HQWindowViewPriorityLow = 200,
    HQWindowViewPriorityMiddle = 300,
    HQWindowViewPriorityHigh = 400,
    HQWindowViewPriorityVeryHigh = 500,
};

@interface THWindowPriority : NSObject

+ (UIView *)currentView;

+ (NSInteger)currentPriority;

+ (BOOL)currentReplaceable;

/**
 检查window弹窗权限

 @param priority 优先级
 @return 是否允许
 */
+ (BOOL)checkPriority:(NSInteger)priority;

/**
 请求window弹窗权限

 @param priority 弹窗优先级
 @param view 弹窗view
 @param replaceable 是否允许显示过程中被其他弹窗替换
 @return 是否允许弹窗
 */
+ (BOOL)requestPriority:(NSInteger)priority view:(UIView *)view replaceable:(BOOL)replaceable;

+ (BOOL)requestPriority:(NSInteger)priority view:(UIView *)view;

/**
 释放window弹窗

 @param priority 弹窗优先级
 @param view 弹窗view
 */
+ (void)releasePriority:(NSInteger)priority view:(UIView *)view;

+ (void)clean;

@end
